﻿<!--#include file="../lib/base.asp"-->
<!--#include file="../theme.asp"-->
<%
if not(sdcms.is_login) then
	sdcms.echo "error=登录超时"
	sdcms.die
end if
if not(sdcms.checkpost) then
	sdcms.echo "error=禁止外部提交"
	sdcms.die
end if
dim userdata:userdata=sdcms.userinfo
dim userid:userid=userdata(0)
dim t1:t1=sdcms.base64_jpg(sdcms.fpost("png1",0))
dim t2:t2=sdcms.base64_jpg(sdcms.fpost("png2",0))
dim t3:t3=sdcms.base64_jpg(sdcms.fpost("png3",0))
dim avatar:avatar=webroot&sdcms.getsys("upfile")&"/avatar/"&userid&"/"
sdcms.newavatar avatar,"big.jpg",t1
sdcms.newavatar avatar,"normal.jpg",t2
sdcms.newavatar avatar,"small.jpg",t3
sdcms.db.dbupdate "sd_user","id="&userid&"",array(array("avatar",userid,0,0))
sdcms.resetuserinfo "u.id="&userid&""
sdcms.echo "success=保存成功"
%>